{# The open transactions (db_transactions), read like Logs: on Postgres every connection, with what it waits on and whom it blocks, ended one by one; on SQLite each one held a while (db_activity.SHOWN_AFTER), with where its code is now, ended by restarting its container. Fixed columns keep each name on one line; the statement (or the code) is cut at the edge, a click opens it (kept open as the table re-sends itself, ``data-row``), and its copy takes it whole. Red past the slow threshold. #} {% from "components/macros/form.html" import action %} {% from "components/macros/layout.html" import badge %} {% from "pages/overseer/_macros.html" import opens_rows, row_cell, rows_head %} {% from "pages/overseer/database/_macros.html" import copy_cell %} {% set cell = row_cell("whitespace-nowrap truncate") %} {# How the transaction stands, either engine: its state, how long open. #} {% macro held(row) %}
{{ transactions_summary }} ยท {% if transactions_postgres %}Every connection to this database, the longest open transaction first. Red past {{ threshold }} s. End rolls its transaction back and closes it.{% else %}SQLite has one writer: a transaction held here makes every other process wait. Each one held past {{ shown_after|round|int }} s, with the code holding it, red past {{ threshold }} s. SQLite cannot end another process's transaction, so Restart restarts the container holding it.{% endif %}
{% if transactions %}| {{ row.wait or "-" }} | {% set blocked = row.blocked_by|join(", ") if row.blocked_by else "-" %}{{ blocked }} | {{ copy_cell(row.query, "query", lang="sql") }} {% else %} {{ copy_cell(row.container, "container") }} {{ copy_cell(row.code, "code", opens=True) }} {{ held(row) }} {% endif %}{% if row.end_url %}{{ action("End" if row.pid else "Restart", hx_dialog(row.end_url, "data-write"), "warn") }}{% endif %} |
Nothing held right now
{% endif %}